local love = require 'love'
local fontHandler = require('assets-handler.font-handler')
local numToChinese = require('utils.num-to-chinese')

local setColor = love.graphics.setColor
local printg = love.graphics.print

local width = Width
local height = Height
local padding = Padding

local turns = {
    text = 0,
    textX = 0,
    textY = 0,
    fontSize = 35,
    fontColor = {0.08, 0.24, 0.4}
}

local function init()
    fontHandler.setChineseFont(turns.fontSize)
    turns.textY = padding + height / 30 + padding
end

local function drawTurns(turn)
    fontHandler.setChineseFont(turns.fontSize)
    turns.text = "第" .. numToChinese.numberToUpperChinese(turn) .. "回合"
    local textWidth = fontHandler.getFontWidth(turns.text)
    turns.textX = (width - textWidth) / 2
    setColor(turns.fontColor)
    printg(turns.text, turns.textX, turns.textY)
end

return{
    init = init,
    drawTurn = drawTurns
}